const path = require('path')
    //const webpack = require('webpack')

function resolve(dir) {
    return path.join(__dirname, '..', dir)
}

module.exports = {
    //baseUrl: '/',
    publicPath: process.env.NODE_ENV === (!'production') ? '/public/' : './',
    ///publicPath: process.env.NODE_ENV === ('production') ? '/admin/' : '/',
    //outputDir: 'dist', // 打包的目录
    outputDir: __dirname+'/../server/admin', // 打包的目录
    lintOnSave: true, // 在保存时校验格式
    productionSourceMap: false, // 生产环境是否生成 SourceMap
    /*build:{
    	assetsPublicPath:'./'
    },*/
    /*baseUrl:'./',*/
    devServer: {
        open: true, // 启动服务后是否打开浏览器
        host: '0.0.0.0',
        port: 8080, // 服务端口
        https: false,
        hotOnly: false,
        proxy: null, // 设置代理
        //before: app => {}
    },
    /* configureWebpack: { //调整webpack 配置
        resolve: {
            alias: {
                //'@': resolve('src'),
                //'common': resolve('src/common'),
                'styles': resolve('src/assets/styles')
            }
        }
    }, */
    chainWebpack: config => {
        config.resolve.alias
            .set('vue$', 'vue/dist/vue.esm.js')
            //.set('@', resolve('src'))
            .set('@assets', resolve('src/assets'))
            .set('components', resolve('src/components'))
            .set('common', resolve('src/common'))
            .set('base', resolve('src/base'))
            //.set('base', resolve('src/base'))
            //.set('api', resolve('src/api')),
        config.resolve.symlinks(true)
    }
}